package com.gzhryc.shared_device.oem.code.config.dao.db;

import com.gzhryc.jdbc.annotaion.*;
import com.gzhryc.shared_device.oem.code.config.dao.enums.AgreementDocumentEnum;

import java.util.Date;

@Table(name="config_agreement_document")
public class AgreementDocument {

    @Id
    protected Long id;

    @UniqueKey(name = "code_appId")
    @Column(notNull = true)
    protected String code;

    @UniqueKey(name = "code_appId")
    @Column(name="app_id",notNull = true)
    protected String appId;

    @Column(name="app_type",notNull = true)
    protected Integer appType;

    @Column(notNull = true)
    protected String title;

    @Column(type = "TEXT",notNull = true)
    protected String content;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public Integer getAppType() {
        return appType;
    }

    public void setAppType(Integer appType) {
        this.appType = appType;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getAppTypeName(){
        return AgreementDocumentEnum.AppType.note(this.appType);
    }
}
